package com.base.cn.platform.os.common.msg;

/**
 * 微信消息模板枚举对象
 *
 * @author s.li
 * @date 2019/05/28
 */
public enum WXTmpEnum {

    REGISTER("REGISTER","OPENTM416962225","新用户注册成功","注册成功通知"),
    ORDER("ORDER","OPENTM414419705","订单消息","支付成功通知"),
    LIVE("LIVE","OPENTM405828852","直播通知","课程确认提醒"),

    //共用一个模板
    EXAM("EXAM","OPENTM416123750","完成考试","成绩发布通知"),
    MARKING("MARKING","OPENTM416123750","完成试卷批阅","成绩发布通知"),

    //共用一个模板
    AGENT_SUCCESS("AGENT_SUCCESS","OPENTM415974001","申请推广员成功消息","入驻审核结果提醒"),
    AGENT_FAIL("AGENT_FAIL","OPENTM415974001","申请推广员未通过消息","入驻审核结果提醒"),

    PUSH_TASK("PUSH_TASK","OPENTM405822560","发布作业","作业提醒"),
    QA_REPLY("QA_REPLY","OPENTM416215703","问答已回复","问题处理结果提醒"),
    FEEDBACK("FEEDBACK","OPENTM410741701","意见反馈消息","反馈处理结果通知"),
    COUPON_CODE("COUPON_CODE","OPENTM202841150","优惠券消息","缴费成功通知"),
    REFUND("REFUND","OPENTM417749729","退费账户消息","退费通知"),
    CASH("CASH","OPENTM414005942","提现账户消息","提现结果通知");

    /**代码业务Key*/
    private String key;
    /**微信平台公用ID*/
    private String idNo;
    /**业务消息使用的名字串*/
    private String names;
    /**微信平台中的名字*/
    private String wxDesc;

    private WXTmpEnum(String key, String idNo, String names, String wxDesc){
        this.key = key;
        this.idNo = idNo;
        this.names = names;
        this.wxDesc = wxDesc;
    }

    public static WXTmpEnum getWXTmpEnum(String key){
        for(WXTmpEnum wxTmpEnum : values()){
            if(wxTmpEnum.getKey().equals(key)){
                return wxTmpEnum;
            }
        }
        return null;
    }

    public static String getIdNoByKey(String key){
        for(WXTmpEnum wxTmpEnum : values()){
            if(wxTmpEnum.getKey().equals(key)){
                return wxTmpEnum.getIdNo();
            }
        }
        return null;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getIdNo() {
        return idNo;
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public String getNames() {
        return names;
    }

    public void setNames(String names) {
        this.names = names;
    }

    public String getWxDesc() {
        return wxDesc;
    }

    public void setWxDesc(String wxDesc) {
        this.wxDesc = wxDesc;
    }
}
